<?php namespace Home\Controller; 

//会员中心控制器
class MemberController extends CommonController{
	
	public function __init(){
		parent::__init();
	}
	
	public function index(){
		View::make();
	}
	
	public function orderList(){
//		p($_SESSION);die;
		$uid=$_SESSION['uid'];
		
//		查询订单表，当前用户的所有订单数据
//		$data=Db::table('orders')->where('uid',$uid)->get();
//		p($data);die;
		$data=Db::table('orders o')
		->join('orders_list ol','o.oid','=','ol.oid')
		->join('goods g','ol.gid','=','g.gid')
		->where('uid',$uid)
		->get();
//		p($data);die;
		View::with('data',$data);
		View::make();
	}
	
	public function daifahuo(){
		
		$uid=$_SESSION['uid'];
		
		$data=Db::table('orders o')
		->join('orders_list ol','o.oid','=','ol.oid')
		->join('goods g','ol.gid','=','g.gid')
		->where('uid',$uid)
		->where('status','待发货')
		->get();
		
//		p($data);die;
		View::with('data',$data);
	
		View::make();
	}
	
	
	public function yifahuo(){
		
		
		
		$uid=$_SESSION['uid'];
		
		$data=Db::table('orders o')
		->join('orders_list ol','o.oid','=','ol.oid')
		->join('goods g','ol.gid','=','g.gid')
		->where('uid',$uid)
		->where('status','已发货')
		->get();
		
//		p($data);die;
		View::with('data',$data);
	
		View::make();
	}
	
	
	
	public function weifk(){
		
		
		
		$uid=$_SESSION['uid'];
		
		$data=Db::table('orders o')
		->join('orders_list ol','o.oid','=','ol.oid')
		->join('goods g','ol.gid','=','g.gid')
		->where('uid',$uid)
		->where('status','未付款')
		->get();
		
//		p($data);die;
		View::with('data',$data);
	
		View::make();
	}
	
	
	
	
	
	
	
	
	
}
